<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="assets/css/bootstrap.min.css" />
<link rel="stylesheet" href="assets/css/doc.css" />
<link rel="stylesheet" href="assets/ztree/css/zTreeStyle/zTreeStyle.css" />
<style type="text/css">
	.active{border-bottom: 3px solid red;}
</style>
<title>POST</title>
</head>
<body>
	<div class="navbar navbar-inverse navbar-fixed-top" role="banner">
		<div class="container">
			<div class="navbar-header">
				<button class="navbar-toggle" type="button" data-toggle="collapse"
					data-target=".bs-navbar-collapse">
					<span class="sr-only">Toggle navigation</span> <span
						class="icon-bar"></span> <span class="icon-bar"></span> <span
						class="icon-bar"></span>
				</button>
				<a href="." class="navbar-brand" style="font-family: 微软雅黑;">数据家乡</a>
			</div>
			<nav class="collapse navbar-collapse bs-navbar-collapse"
				role="navigation">
				<ul class="nav navbar-nav">
					<li class="active" style=""><a href="">发布信息</a></li>
					<li><a href="create.html">开通站点</a></li>
				</ul>
			</nav>
		</div>
	</div>
	<div class="container bs-docs-container">
		<div class="row">
			<div class="col-md-12">
			<h1>发布信息 <small>向指定的村发送信息</small></h1>
			
			</div>
		</div>
		<div class="row">
			<div class="col-md-3">
				<ul id="tree" class="ztree" style="width:230px; overflow:auto;"></ul>
				
			</div>
			<div class="col-md-9">
				<form action="/discuz/rest/forum/publish" method="post">
					<div class="form-group">
					<div class="row">
					<div class="col-md-6">
					<label>版块Id</label>
						<input type="hidden" class="form-control" name="fid"  id="fid" value="72" />
						<input type="text" class="form-control" id="fname" value="72" /><br>
					</div>
					<div class="col-md-6">
					<label>分类Id</label>
						<!-- <input type="text" class="form-control" name="sortid" value="0" /> --><br>
						<select id="sortid" name="sortid" class="form-control" >
							<option value="0">全部</option>
						</select>
						</div>
					</div>
					
					<label>标题</label>
						<input type="text" class="form-control" name="subject"
							value="根据公司业务发展需要，经科技公司总裁室研究决定" /><br> 
						
					<label>内容</label>
					<textarea class="form-control" rows="10" name="message" id="message" >根据公司业务发展需要，经科技公司总裁室研究决定如下任免根据公司业务发展需要，经科技公司总裁室研究决定如下任免根据公司业务发展需要，经科技公司总裁室研究决定如下任免</textarea>
						<br> 
						<input type="submit" class="btn btn-success" value="提&nbsp;&nbsp;交" />
						<input type="reset" class="btn btn-warning" value="清&nbsp;&nbsp;空" /><br>
					</div>
				</form>
			</div>
		</div>
	</div>
	
<script type="text/javascript" src="assets/js/jquery.min.js"></script>
<script type="text/javascript" src="assets/js/bootstrap.min.js"></script>
<script type="text/javascript" src="assets/ztree/js/jquery.ztree.all-3.5.min.js"></script>

<script type="text/javascript">
	<!--

	var setting = {
		view : {
			selectedMulti : false
		},async: {
			enable: true,
			url: "/discuz/rest/forum/child",
			autoParam: ["fid",212],
			otherParam:{"type":"sub"},
			type:"get",
			dataType:"json",
		},
    	callback: {
    		onClick: ztreeOnClick,
    		onAsyncSuccess: ztreeOnAsyncSuccess
    	}

	};
	
	//点击树节点操作
	function ztreeOnClick(event, treeId, treeNode) {
		if (treeNode.fid != "" || undefined != treeNode.fid)
			$("#fid").attr("value", treeNode.fid);
		else
			$("#fid").attr("value", "");
		$("#fname").attr("value", treeNode.name);
	}
	
	//异步加载成功操作
	function ztreeOnAsyncSuccess(event, treeId, treeNode, msg) {
		if (undefined == treeNode) {
			var channelTree = $.fn.zTree.getZTreeObj("channelTree");
			var node = channelTree.getNodeByParam("id", "0");
			channelTree.expandNode(node, true, false, true);
			channelTree.selectNode(node);
			ztreeOnClick(event, treeId, node);
		} else {
			if (treeNode.id == "0") {
				var channelTree = $.fn.zTree.getZTreeObj("#tree");
				var node = channelTree.getNodeByParam("fid", treeNode.fid);
				channelTree.expandNode(node, true, false, true);
			}
		}
	};
	$(document).ready(function() {

		$.ajax({
			cache : false,
			url : "/discuz/rest/forum/group",
			type : "GET",
			dataType : 'json',
			success : function(result, status) {
				var node = result;
				zTreeObj = $.fn.zTree.init($("#tree"), setting, node);
			},
			error : function() {
				alert("get estimate position failed!");
			}
		});

		getType();
	});

	function getType() {
		$.ajax({
			cache : false,
			url : "/discuz/rest/forum/type",
			type : "GET",
			dataType : 'json',
			success : function(result, status) {
				$("#sortid").empty();
				$("#sortid").append(
						"<option value='0' selected='selected'>全部</option>");
				for ( var i = 0; i < result.length; i++) {
					$("#sortid").append(
							"<option value='"+result[i].typeid+"'>"
									+ result[i].name + "</option>");
				}
			},
			error : function() {
				alert("get estimate position failed!");
			}
		});
	}
//-->
</script>


</body>
</html>